﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SnmpForm.FaultDetect
{

    public class FaultDetectConfigItem : APConfig.ApConfigItem
    {
        public FaultDetectConfigItem(string text, object value)
            : base(text, value)
        {
        }
    }

    public class FAULT_DEFINE_DATA
    {
        static public FaultDetectConfigItem[]
            FAULT_STATUS_TYPE = {new FaultDetectConfigItem("当前故障AP", 0), 
                              new FaultDetectConfigItem("历史故障AP", 1)};

        static public FaultDetectConfigItem[]
            FAULT_NAME_TYPE = { new FaultDetectConfigItem("全部", -1), 
                              new FaultDetectConfigItem("不在线", 101), 
                              new FaultDetectConfigItem("验证错误", 102),
                              new FaultDetectConfigItem("未知异常", 103)};

        static public FaultDetectConfigItem find(FaultDetectConfigItem[] items, object value, out int index)
        {
            index = 0;
            FaultDetectConfigItem item = null;
            for (int nIndex = 0; nIndex < items.Length; nIndex++)
            {
                if (items[nIndex].Value.Equals(value))
                {
                    item = items[nIndex];
                    index = nIndex;
                }
            }
            return item;
        }
    }
}
